//
//  HBFindViewController.swift
//  sinaWeibo
//
//  Created by Beans on 16/6/23.
//  Copyright © 2016年 iceWorks. All rights reserved.
//

import UIKit

class HBFindViewController: HBBaseTableViewController {

    //    init() {
    //        // 控制器的指定构造函数
    //        super.init(nibName: nil, bundle: nil)
    //    }
    //
    //    required init?(coder aDecoder: NSCoder) {
    //        fatalError("init(coder:) has not been implemented")
    //    }

    override func viewDidLoad() {
        super.viewDidLoad()

        visitorView.setupInfo(false, image: "visitordiscover_image_message", message: "登录后，最新、最热微博尽在掌握，不再会与实事潮流擦肩而过")
        tabBarItem.badgeValue = "99+"

        // 问题一: progress很少用
        // 问题二: NSURLSessionDataTask很少用
        // 问题三: 返回的JSON属于`AnyObject?`
//        HBHTTPClient.shareInstance.request(.GET, URLString: "", parameters: nil, progress: nil, success: { (_, JSON) -> Void in
//
//            }) { (_, error) -> Void in
//
//        }

        // 隐忧 -- 防止别人调用这个方法
//        let client = HBHTTPClient()
//        printLog(client)

        // 定义成功/失败的闭包
        let successClosure = { (JSON: AnyObject?) -> Void in
        }
        let failureClosure = { (error: NSError) -> Void in
        }

//        HBHTTPClient.shareInstance.request(.GET, URLString: "", parameters: nil, progress: nil, success: { (JSON) -> Void in
//
//            }) { (error) -> Void in
//
//        }

        HBHTTPClient.shareInstance.request(.GET, URLString: "", parameters: nil, success: successClosure, failure: failureClosure)

    }

    override func didReceiveMemoryWarning() {
        super.didReceiveMemoryWarning()
    }

}
